package Tutorial;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class Firefox {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception{
		WebDriver driver = new FirefoxDriver();
		driver.get("https://www.google.com/");
		
		WebDriverWait wait = new WebDriverWait(driver, 2);
		
		WebElement elementoBusca = wait.until(ExpectedConditions.presenceOfElementLocated(By.id("gbqfq")));
		
		elementoBusca.sendKeys("selenium");
		
		Thread.sleep(2000);
		elementoBusca.sendKeys(Keys.ARROW_DOWN);
		elementoBusca.sendKeys(Keys.ARROW_DOWN);
		Thread.sleep(2000);
		elementoBusca.sendKeys(Keys.ENTER);
		
	}

}
